Generally, in a one-chip type computer system, such as a microcomputer, for example, software is tested and debugged and the operation of the hardware is checked by an in-circuit emulator.
In this type of emulation, the program (target program) is executed by a computer system which becomes the target of the emulation, which is the target system, the pattern of optional execution information is detected by the tracing function during that execution, the target program is interrupted at an intended break point by the breaking function in order to check the state of each part within the system, and the software and hardware of the target system are checked and debugged.
In many emulators of this type, the memory contents of the major memories and registers within the target system are read out by the scan-path method.
The scan-path method will be explained with FIG. 4. In FIG. 4, the target system 100 is a microprocessor or a DSP (digital signal processor), for example, and various kinds of registers are distributed in each part and arranged within. Among these various kinds of registers, registers that make up the major part of the system, such as registers for the address system and registers for the control system, for example, and registers for the data system, such as an accumulator register and a memory I/O register, for example, that specify the register names by commands from the program and write data to or read data from these (I/O registers), are integrated into a scan-path {circumflex over (1)}.
Each of the registers that are integrated into the scan-path is structured to input and output data in parallel in normal mode and input and output data serially in the scan-path mode.
Generally, one scan-path is provided within one computer system, and a number of registers are serially connected in this scan-path. For example, in the target system 100 in FIG. 4, 7 registers RA1, RA2, RB1, RB2, RB3, RC1, and RC2 are serially connected in the scan-path (1). These registers RA1, RA2, RB1, RB2, RB3, RC1, and RC2 are accessed in parallel in normal operations, and all of these are serially accessed when the scan-path is used. Both ends of this scan-path {circumflex over (1)} are connected to the emulator 110 through multiplexers 102 and 104 and data input and output terminals 106 and 108.
Also in FIG. 4, the register bypass is a register that is used when bypass is performed without using the scan-path in the emulation mode. A number of ICs are mounted on the same printed substrate, and when one IC is debugged by the scan-path, other IC's bypass signals via the aforementioned register bypass. Both ends of this bypass 2 are connected to the emulator 110 through multiplexers 102 and 104 and data input and output terminals 106 and 108.
Also in FIG. 4, registers RI1 and RI2 are command registers, and commands for switching the multiplexers 102 and 104 and for switching each mode are set. Also, these registers RI1 and RI2 include a command decoder.
When the program of the target system 100 is stopped at a prescribed break point in the emulation, the information indicating the system state at that point is held at each of the registers RA1, RA2, RB1, RB2, RB3, RC1, and RC2.
The emulator 110 switches the multiplexers 102 and 104 and selects the scan-path 1, supplies a prescribed clock [signal] to each register on this scan-path 1, and serially moves the contents of each register on the scan-path 1 and sequentially reads them out to the outside of the target system 100 and takes them in.
Because the emulator 110 knows beforehand what register is positioned in what order on each scan-path, for each register it can separate a series of serial data taken in from the scan-path 1 and recognizes the contents (information) of each register.
By the aforementioned emulation by the scan-path method, stored information within the system, particularly programs and other data stored within a mask ROM (read-only memory) built within the system can be easily read out from outside the system even with one-chip type computer systems that do not have the program bus pin. In other words, it is easy to copy all memory information within ROM.
In this way, the danger of the ROM information of the system being illegally copied remains because of the scan-path function.
When the secrecy of the ROM information had to be maintained in a computer system of this type, the signal path for connecting the interface circuit within the system relative to the emulation and the external emulation was interrupted by the hardware, and signals could not be exchanged between them.
However, in this method, the signal path was completely interrupted once copy protection was applied, and there was the inconvenience that debugging and testing afterwards could not be performed at all.
The aim of this invention, which was made while considering said problem, is to offer a computer system in which execution or cancellation of copy protection can be switched at any time in a simplified structure.
Also, another aim of this invention is to offer a computer system that has a copy protection function with a high level of security and flexibility.